home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / Mac F2C 1.2.2 / MPW Support / F2CExamples / test.make < prev    next >
Encoding:
Text File  |  1995-08-09  |  1.7 KB  |  63 lines  |  [TEXT/MPS ]

  1. #   File:       test.make
  2. #   Target:     test
  3. #   Sources:    test.c
  4.  
  5. Makefile = test.make
  6.  
  7. fsource =    test.f 
  8.             
  9. csource =    main.c
  10.  
  11. fobjs     =    test.f.o  
  12.             
  13. cobjs    =    main.c.o
  14.  
  15.  
  16. objects =    {fobjs} ∂
  17.             {cobjs}
  18.  
  19. C            =    MWCPPC
  20. COptions    =    -align power -nosyspath -i "{CIncludes}"
  21. F2C            =    f2c
  22. #F2COptions    =    -f -!i8 -A -P -a -E -ec -!R -r8 -s -w66 -Nq150 -Nx200 -Ns801 -Nc20 -Nn401 -NL200 -NC99 -Nl256 
  23. F2COptions    =    -f -!i8 -A -a -E -ec -!R -r8 -w66
  24. Link        =    MWLinkPPC
  25. LinkOptions    =    -d -c 'MPS ' -t 'MPST' -fastlink off
  26. test ƒƒ   {objects} {Makefile}
  27.     {Link} {LinkOptions} ∂
  28.         {OBJECTS} ∂
  29.         "{MWPPCLibraries}"MWStdCRuntime.Lib   ∂
  30.         "{MWPPCLibraries}"StdCLib   ∂
  31.         "{MWPPCLibraries}"InterfaceLib   ∂
  32.         "{MWPPCLibraries}PPCToolLibs.o" ∂
  33.         "{MWPPCLibraries}"MathLib   ∂
  34.         "{F2CLibraries}"libI77.PPC   ∂
  35.         "{F2CLibraries}"libF77.PPC   ∂
  36.         -o test
  37.  
  38. test  ƒƒ test.r {Makefile}
  39.     Rez -a -o test -d APPNAME=∂"test∂" test.r
  40.  
  41. .f.o    ƒ    .f
  42.     {F2C} {F2COptions} {Default}.f     #compile the fortran and then compile the resulting C file.
  43.     setfile -t "TEXT" -c "MPS " {default}.c
  44.     {C} {COptions} {default}.c -o {Targ}
  45.  
  46.  
  47. .c.o    ƒ    .c
  48.     {C} {COptions} {default}.c -o {Targ}
  49.  
  50. # If you FORTRAN code has common blocks add common.c.o to the cobjs list 
  51. # and then this rule should take care of it
  52. common.c    ƒ    {fobjs}
  53.     setfile -t "TEXT" -c "MPS " ?+_com.c
  54.     catenate ?+_com.c > {Targ}    #This puts all the common block files into one file for compiling.
  55.                                 #The wild card lets us add common blocks to the fortran code
  56.                                 #without having to change the makefile!  The common block files all
  57.                                 #end with _com.c
  58.  
  59. {objects}    ƒ    {Makefile}        #do a full rebuild if the makefile changes
  60.  
  61. # makefile end
  62.  
  63.